<script>
function setTab(name,cursel,n){
 for(i=1;i<=n;i++){
  var menu=document.getElementById(name+i);
  var con=document.getElementById("con_"+name+"_"+i);
  menu.className=i==cursel?"hover":"";
  con.style.display=i==cursel?"block":"none";
 }
}
</script>
<div class="hot_links">
  <h2>
    <div class="com_tit"><?php echo $title; ?></div>
  </h2>
  <ul class="hot_links_tab">
    <li id="two1" onmouseover="setTab('two',1,2)"  class="hover" style="border-right:1px solid #C7C7C7;">今日热门</li><li id="two2" onmouseover="setTab('two',2,2)">本周热门</li>
  </ul>

  <!--今日热门 -->
  <div id="con_two_1" class="hot_links_box hover">
  <?php
  echo '<!--'. $sqlStr .'-->';
  echo '<!--'. $sqlStr2 .'-->';
	 foreach($newsArray as $row_array)
	 {
         $image = $row_array["snapshot_big"];
         if($image == null || $image == "")
             $image = sfConfig::get("app_no_image");
  ?>
    <div class="hot_links_li">
      <div class="hot_img"><?php echo link_to("<img src=\"".$image."\" >","news/detail?id=".$row_array["news_id"],"target='_blank'") ?></div>
      <div class="hot_text">
        <h3><?php echo link_to($row_array["title"],"news/detail?id=".$row_array["news_id"],"target='_blank'") ?></h3>
        <div class="hot_time">发布时间
            <?php
                     echo utility::DateDiff(date("Y-m-d H:i:s"),$row_array["publish_time"]);
            ?>
        </div>
      </div>
    </div>

 <?php
      }
?>
    </div>
  <!--本周热门 -->
  <div id="con_two_2" class="hot_links_box" style="display:none">
  <?php
	 foreach($newsArray2 as $row_array)
	 {
         $image = $row_array["snapshot_big"];
         if($image == null || $image == "")
             $image = sfConfig::get("app_no_image");
   ?>
    <div class="hot_links_li">
      <div class="hot_img"><?php echo link_to("<img src=\"".$image."\" >","news/detail?id=".$row_array["news_id"],"target='_blank'") ?></div>
      <div class="hot_text">
        <h3><?php echo link_to($row_array["title"],"news/detail?id=".$row_array["news_id"],"target='_blank'") ?></h3>
        <div class="hot_time">发布时间
           <?php
                  echo utility::DateDiff(date("Y-m-d H:i:s"),$row_array["publish_time"]);
           ?>
        </div>
      </div>
    </div>
<?php
     }
?>
  </div>
</div>
 
